
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head>
		<style>
body {
	background-color: #F7F7F7;
	background: url(../include/images/admin/login-bg.png);
	font-size: 12px;
}

.loginPanel {
	width: 500px;
	margin: 0 auto;
	margin-top: 180px;
}

#verifyCode {
	vertical-align: middle;
}
</style>
		<link href="#{request.contextPath}/include/css/admin.css"
			type="text/css" rel="stylesheet" />
		<link href="#{request.contextPath}/include/css/login.css"
			type="text/css" rel="stylesheet" />
	</h:head>
	<f:event type="preRenderComponent"
		listener="#{loginUtil.setSession('loginType','admin')}"></f:event>
		
	<script>
		//<![CDATA[
		      function onfocus(a){
		    	  a.removeClass("ui-state-focus");
		      }     
	//]]>
		</script>
	<form action="#{request.contextPath}/login" method="post"
		style="width: 280px;position: absolute;left: 50%;height: 532px;padding: 35px;color: #EEE;left: 50%;top: 100px;margin-left: -175px;"
		accept-charset="UTF-8">
		<ui:fragment
			rendered="#{ not empty requestScope['SPRING_SECURITY_LAST_EXCEPTION'] and requestScope['SPRING_SECURITY_LAST_EXCEPTION'].message ne 'Authentication method not supported: GET'}">
			<script>
				$(function() {
					growl
							.renderMessage({
								summary : '错误',
								detail : '#{requestScope['SPRING_SECURITY_LAST_EXCEPTION'].message}',
								severity : 'error'
							});
				});
			</script>
			<!--             <li style="color: red;"> -->
			<!--                 #{requestScope['SPRING_SECURITY_LAST_EXCEPTION'].message} -->
			<!--             </li> -->
		</ui:fragment>
		<ui:fragment
			rendered="#{not empty request.getParameter('spring-security-redirect')}">
			<input type="hidden" name="spring-security-redirect"
				value="#{request.getParameter('spring-security-redirect')}"></input>
		</ui:fragment>
		
		<div class="input_outer">
			<span class="us_uer"></span>
			<p:inputText styleClass="text" label="用户名" id="j_username"
				required="true" onfocus="onfocus();"></p:inputText>
		</div>
		<h:outputLabel value="密码也是大名小写全拼yeah"></h:outputLabel>

		<div class="input_outer">
			<span class="us_uer"></span>
			<p:password styleClass="text" id="j_password" onfocus="onfocus();"></p:password>

		</div>
		<h:outputLabel value="验证码"
			rendered="#{sessionScope.need_validate_code or configHome.getConfigValue('login_fail_max_times') eq '0'}"></h:outputLabel>
		<h:outputLabel
			rendered="#{sessionScope.need_validate_code or configHome.getConfigValue('login_fail_max_times') eq '0'}">
			<p:inputText id="captcha_input" style="width:60px;"></p:inputText>
			<img alt="点击刷新" id="verifyCode"
				src="#{request.contextPath}/verifyCodeServlet"
				onclick="this.src='#{request.contextPath}/verifyCodeServlet?'+new Date().getTime()" />
		</h:outputLabel>

		<p:spacer></p:spacer>
		<p:outputPanel>
			<p:commandButton value="登录" onclick="submit();"></p:commandButton>
		</p:outputPanel>
		<div class="login-logo">
			<img src="#{request.contextPath}/include/images/admin/login-logo.png"
				style="width:135px;height:120px;" />
		</div>
		<div class="clear"></div>
	</form>
	

</f:view>
